xen/arm: Don't free p2m->root in p2m_teardown() before it has been allocated
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 2 Jun 2016 13:19:00 +0000 (14:19 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 3 Jun 2016 10:26:51 +0000 (11:26 +0100)
commit9ab1bd9ab64799816c8223a5f210b7a767ab4ccc
treeefb85c973f89d52156d11741fb92e2eab3fbda95
parente228585d122817f987806145b09de7914c42a5fe
xen/arm: Don't free p2m->root in p2m_teardown() before it has been allocated

If p2m_init() didn't complete successfully, (e.g. due to VMID
exhaustion), p2m_teardown() is called and unconditionally tries to free
p2m->root before it has been allocated.  free_domheap_pages() doesn't
tolerate NULL pointers.

This is XSA-181

Reported-by: Aaron Cornelius <Aaron.Cornelius@dornerworks.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/p2m.c